package a.j;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.awt.image.ConvolveOp;
import java.awt.image.Kernel;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

public class qg
  extends pg
  implements PropertyChangeListener
{
  pg F;
  d_ G;
  boolean H;
  private Rectangle2D I;
  private final b_ J = new b_();
  private static boolean K = false;
  public static int L;
  
  public qg(pg parampg)
  {
    super(parampg.a(), null);
    a(new c_(this));
    B().addKeyListener(new KeyListener()
    {
      public void keyTyped(KeyEvent paramAnonymousKeyEvent) {}
      
      public void keyReleased(KeyEvent paramAnonymousKeyEvent) {}
      
      public void keyPressed(KeyEvent paramAnonymousKeyEvent)
      {
        boolean bool2 = ld.E;
        boolean bool1 = ld.D;
        if (!bool2) {
          if (!Boolean.TRUE.equals(qg.this.getClientProperty("Overview.AllowKeyboardNavigation"))) {
            return;
          }
        }
        if (!bool2) {}
        Point2D localPoint2D;
        switch (paramAnonymousKeyEvent.getKeyCode())
        {
        case 109: 
          qg.this.F.b(qg.this.F.M() / 1.25D);
          qg.this.F.b();
          if (!bool2) {
            if (!bool1) {
              return;
            }
          }
        case 107: 
          qg.this.F.b(qg.this.F.M() * 1.25D);
          if (!bool2)
          {
            qg.this.F.b();
            if (!bool1) {
              return;
            }
          }
        case 37: 
          localPoint2D = qg.this.F.J();
          qg.this.c(localPoint2D.getX() - qg.this.F.B().getWidth() * 0.5D / qg.this.F.M(), localPoint2D.getY(), 0.5D);
          if (!bool2) {
            if (!bool1) {
              return;
            }
          }
        case 39: 
          localPoint2D = qg.this.F.J();
          qg.this.c(localPoint2D.getX() + qg.this.F.B().getWidth() * 0.5D / qg.this.F.M(), localPoint2D.getY(), 0.5D);
          if (!bool2) {
            if (!bool1) {
              return;
            }
          }
        case 38: 
          localPoint2D = qg.this.F.J();
          qg.this.c(localPoint2D.getX(), localPoint2D.getY() - qg.this.F.B().getHeight() * 0.5D / qg.this.F.M(), 0.5D);
          if (!bool2) {
            if (!bool1) {
              return;
            }
          }
        case 40: 
          localPoint2D = qg.this.F.J();
          qg.this.c(localPoint2D.getX(), localPoint2D.getY() + qg.this.F.B().getHeight() * 0.5D / qg.this.F.M(), 0.5D);
        }
      }
    });
    new sb(this);
    hc localhc = W();
    if (!ld.E)
    {
      if ((localhc instanceof mb))
      {
        mb localmb = (mb)localhc;
        localmb.c(true);
        localmb.f(true);
      }
      this.F = parampg;
      this.F.C().addPropertyChangeListener(this);
      this.F.addPropertyChangeListener(this);
      this.G = new d_(null);
      a(21, 31);
      c(1.7976931348623157E+308D);
    }
  }
  
  og h()
  {
    return new a_(this);
  }
  
  private static double a(double paramDouble1, double paramDouble2, double paramDouble3)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    double d1 = 0.0D;
    double d2 = paramDouble3 - 0.5D;
    label133:
    label135:
    do
    {
      do
      {
        if (d2 >= paramDouble3 + 0.6D) {
          break;
        }
        if (bool1) {
          break label153;
        }
        double d3 = paramDouble2 - 0.5D;
        do
        {
          do
          {
            if (d3 >= paramDouble2 + 0.6D) {
              break;
            }
            d1 += 1.0D / (6.283185307179586D * paramDouble1 * paramDouble1) * Math.pow(2.718281828459045D, -(d3 * d3 + d2 * d2) / (2.0D * paramDouble1 * paramDouble1));
            d3 += 0.1D;
            if (bool2) {
              break label135;
            }
            if (bool1) {
              break label133;
            }
          } while (!bool1);
        } while (bool2);
        d2 += 0.1D;
      } while (!bool1);
    } while (bool2);
    d1 /= 121.0D;
    label153:
    return d1;
  }
  
  private static float[] a(double paramDouble, int paramInt)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    float[] arrayOfFloat = new float[paramInt * paramInt];
    float f1 = 0.0F;
    int i = 0;
    label113:
    label115:
    do
    {
      if (i >= paramInt) {
        break;
      }
      if (bool1) {
        break label124;
      }
      int j = 0;
      do
      {
        if (j >= paramInt) {
          break;
        }
        float f2 = (float)a(paramDouble, j - paramInt * 0.5D, i - paramInt * 0.5D);
        arrayOfFloat[(j + i * paramInt)] = f2;
        f1 += f2;
        j++;
        if (bool2) {
          break label115;
        }
        if (bool1) {
          break label113;
        }
      } while (!bool1);
      if (!bool2) {
        i++;
      }
    } while (!bool1);
    if (!bool2) {
      label124:
      i = 0;
    }
    do
    {
      while (!bool1)
      {
        if (i >= arrayOfFloat.length) {
          break;
        }
        if ((!bool2) && (bool1)) {
          break label166;
        }
        arrayOfFloat[i] /= f1;
        i++;
      }
    } while (bool2);
    label166:
    return arrayOfFloat;
  }
  
  protected void a(pg parampg)
  {
    Rectangle localRectangle = parampg.a().d();
    parampg.a(localRectangle.x - 20, localRectangle.y - 20, localRectangle.width + 40, localRectangle.height + 40);
  }
  
  public void b()
  {
    boolean bool = ld.E;
    if (!bool) {
      if (this.F == null) {
        return;
      }
    }
    Rectangle localRectangle = this.F.getVisibleRect();
    if (!bool)
    {
      if (this.G != null) {
        this.G.a(localRectangle.getX(), localRectangle.getY(), localRectangle.getWidth(), localRectangle.getHeight());
      }
      this.H = true;
    }
    super.b();
  }
  
  void b(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    boolean bool = ld.E;
    if (!bool) {
      if (this.F == null) {
        return;
      }
    }
    Rectangle localRectangle = this.F.getVisibleRect();
    if (!bool)
    {
      if (this.G != null) {
        this.G.a(localRectangle.getX(), localRectangle.getY(), localRectangle.getWidth(), localRectangle.getHeight());
      }
      this.H = true;
    }
    repaint(paramInt1, paramInt2, paramInt3, paramInt4);
  }
  
  public void reshape(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    super.reshape(paramInt1, paramInt2, paramInt3, paramInt4);
    b();
  }
  
  public void propertyChange(PropertyChangeEvent paramPropertyChangeEvent)
  {
    boolean bool3 = ld.E;
    boolean bool2 = ld.D;
    if (!bool3) {
      if ("Graph2D".equals(paramPropertyChangeEvent.getPropertyName()))
      {
        b(this.F.a());
        if ((!bool3) && (!bool2)) {
          return;
        }
      }
    }
    boolean bool1;
    Rectangle localRectangle;
    Rectangle2D localRectangle2D;
    int i;
    int j;
    int k;
    int m;
    if (!bool3) {
      if ("Zoom".equals(paramPropertyChangeEvent.getPropertyName()))
      {
        bool1 = this.H;
        if (!bool3)
        {
          if (this.I != null)
          {
            localRectangle = this.F.getVisibleRect();
            localRectangle2D = localRectangle.createUnion(this.I);
            double d1 = Math.max(((Double)paramPropertyChangeEvent.getOldValue()).doubleValue(), ((Double)paramPropertyChangeEvent.getNewValue()).doubleValue());
            Point localPoint2 = R();
            i = (int)Math.floor((localRectangle2D.getX() - localPoint2.getX()) * d1);
            j = (int)Math.floor((localRectangle2D.getY() - localPoint2.getY()) * d1);
            k = (int)Math.ceil(localRectangle2D.getWidth() * d1);
            m = (int)Math.ceil(localRectangle2D.getHeight() * d1);
            b(i - 1, j - 1, k + 4, m + 4);
            this.I = localRectangle;
            if (bool3) {
              break label256;
            }
            if (!bool2) {}
          }
          else
          {
            b();
          }
        }
        else {
          this.I = this.F.getVisibleRect();
        }
        this.H = bool1;
        label256:
        if ((!bool3) && (!bool2)) {
          return;
        }
      }
    }
    if ((bool3) || ("ViewPoint".equals(paramPropertyChangeEvent.getPropertyName())))
    {
      bool1 = this.H;
      if (!bool3)
      {
        if (this.I != null)
        {
          localRectangle = this.F.getVisibleRect();
          localRectangle2D = localRectangle.createUnion(this.I);
          Point localPoint1 = R();
          double d2 = M();
          i = (int)Math.floor((localRectangle2D.getX() - localPoint1.getX()) * d2);
          j = (int)Math.floor((localRectangle2D.getY() - localPoint1.getY()) * d2);
          k = (int)Math.ceil(localRectangle2D.getWidth() * d2);
          m = (int)Math.ceil(localRectangle2D.getHeight() * d2);
          b(i - 1, j - 1, k + 4, m + 4);
          this.I = localRectangle;
          if (bool3) {
            break label458;
          }
          if (!bool2) {}
        }
        else
        {
          b();
        }
      }
      else {
        this.I = this.F.getVisibleRect();
      }
      if (bool3) {
        break label462;
      }
      this.H = bool1;
      if (!bool2) {
        label458:
        return;
      }
    }
    label462:
    b();
  }
  
  void c(double paramDouble1, double paramDouble2, double paramDouble3)
  {
    boolean bool = ld.E;
    if ((bool) || (paramDouble3 < 1.0D)) {
      if (!bool)
      {
        if (Boolean.TRUE.equals(getClientProperty("Overview.AnimateScrollTo")))
        {
          this.J.a(paramDouble1, paramDouble2, paramDouble3);
          if (bool) {
            break label68;
          }
        }
      }
      else if (!ld.D) {
        return;
      }
    }
    this.F.a(paramDouble1, paramDouble2);
    label68:
    this.F.b();
  }
  
  static
  {
    try
    {
      String str = System.getProperty("os.name").toLowerCase();
      K = str.startsWith("mac");
    }
    catch (SecurityException localSecurityException)
    {
      K = false;
    }
  }
  
  private static class d_
    implements qb
  {
    private Rectangle2D.Double a = new Rectangle2D.Double();
    private Color b = new Color(100, 100, 100, 100);
    
    private d_() {}
    
    public void a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
    {
      this.a.setRect(paramDouble1, paramDouble2, paramDouble3, paramDouble4);
    }
    
    public void paint(Graphics2D paramGraphics2D)
    {
      Color localColor = paramGraphics2D.getColor();
      paramGraphics2D.setColor(this.b);
      paramGraphics2D.fill(this.a);
      paramGraphics2D.setColor(localColor);
    }
    
    public boolean a(double paramDouble1, double paramDouble2)
    {
      return this.a.contains(paramDouble1, paramDouble2);
    }
    
    public Rectangle getBounds()
    {
      return this.a.getBounds();
    }
    
    d_(qg.4 param4)
    {
      this();
    }
  }
  
  final class b_
    implements ActionListener
  {
    private final Timer a = new Timer(20, this);
    private Point2D.Double b = new Point2D.Double(0.0D, 0.0D);
    private long c;
    private double d;
    
    public b_()
    {
      this.a.setRepeats(true);
      this.a.setDelay(20);
    }
    
    public void actionPerformed(ActionEvent paramActionEvent)
    {
      boolean bool = ld.E;
      Point2D localPoint2D = qg.this.F.J();
      double d1 = qg.this.F.M();
      double d2 = this.b.x - localPoint2D.getX();
      double d3 = this.b.y - localPoint2D.getY();
      double d4 = localPoint2D.getX() + d2 * this.d;
      double d5 = localPoint2D.getY() + d3 * this.d;
      d2 = this.b.x - d4;
      d3 = this.b.y - d5;
      if (!bool)
      {
        if (this.d < 1.0D) {
          if (!bool)
          {
            if (System.currentTimeMillis() <= this.c) {
              if (bool) {
                break label187;
              }
            }
          }
          else {
            if (Math.max(Math.abs(d2), Math.abs(d3)) * d1 >= 5.0D) {
              break label189;
            }
          }
        }
        this.a.stop();
        d4 = this.b.x;
      }
      label187:
      d5 = this.b.y;
      label189:
      qg.this.F.a(d4, d5);
      qg.this.F.b();
    }
    
    public void a(double paramDouble1, double paramDouble2, double paramDouble3)
    {
      this.b.x = paramDouble1;
      this.b.y = paramDouble2;
      this.d = paramDouble3;
      this.c = (System.currentTimeMillis() + 500L);
      if ((ld.E) || (!this.a.isRunning())) {
        this.a.start();
      }
    }
  }
  
  class c_
    extends gf
  {
    double m;
    double G;
    double H;
    double I;
    boolean J;
    double K;
    double L;
    boolean M;
    boolean N;
    
    public c_(df paramdf)
    {
      super();
    }
    
    public void mouseClicked(double paramDouble1, double paramDouble2)
    {
      if ((ld.E) || (!this.N)) {
        qg.this.c(paramDouble1, paramDouble2, 0.5D);
      }
    }
    
    public void mousePressedLeft(double paramDouble1, double paramDouble2)
    {
      if (!ld.E)
      {
        if (!qg.this.G.a(paramDouble1, paramDouble2)) {
          return;
        }
        this.m = paramDouble1;
        this.G = paramDouble2;
        this.H = qg.this.F.J().getX();
        this.I = qg.this.F.J().getY();
      }
      this.J = true;
    }
    
    public void mouseDraggedLeft(double paramDouble1, double paramDouble2)
    {
      if ((ld.E) || (this.J)) {
        qg.this.c(this.H + (paramDouble1 - this.m), this.I + (paramDouble2 - this.G), 1.0D);
      }
    }
    
    public void mouseReleasedLeft(double paramDouble1, double paramDouble2)
    {
      this.J = false;
      this.M = false;
    }
    
    public void mousePressed(MouseEvent paramMouseEvent)
    {
      boolean bool2 = ld.E;
      boolean bool1 = ld.D;
      if (!bool2)
      {
        this.N = false;
        if (Boolean.TRUE.equals(qg.this.getClientProperty("Overview.AllowZooming")))
        {
          int i = qg.this.d(qg.this.G.a.getMaxX());
          int j = qg.this.e(qg.this.G.a.getMaxY());
          if (!bool2)
          {
            if (Math.abs(i - paramMouseEvent.getX()) < 3)
            {
              if (bool2) {
                break label182;
              }
              if (Math.abs(j - paramMouseEvent.getY()) < 3)
              {
                this.M = true;
                this.K = qg.this.F.J().getX();
                this.L = qg.this.F.J().getY();
                if (bool2) {
                  break label182;
                }
                if (!bool1) {
                  return;
                }
              }
            }
            this.M = false;
            if (bool2) {
              break label187;
            }
            super.mousePressed(paramMouseEvent);
          }
          if (!bool1) {
            label182:
            return;
          }
        }
      }
      label187:
      super.mousePressed(paramMouseEvent);
    }
    
    public void mouseDragged(MouseEvent paramMouseEvent)
    {
      boolean bool = ld.E;
      this.N = true;
      if (!bool) {
        if (this.M)
        {
          double d1 = qg.this.f(paramMouseEvent.getX());
          double d2 = qg.this.g(paramMouseEvent.getY());
          double d3 = Math.abs(this.K - d1) * 2.0D;
          double d4 = Math.abs(this.L - d2) * 2.0D;
          double d5 = qg.this.F.B().getWidth() / d3;
          double d6 = qg.this.F.B().getHeight() / d4;
          double d7 = Math.min(d5, d6);
          if (!bool)
          {
            if (d7 == qg.this.F.M()) {
              return;
            }
            qg.this.F.b(d7);
            qg.this.F.a(this.K, this.L);
            if (bool) {
              break label198;
            }
            qg.this.F.b();
          }
          if (!ld.D) {
            return;
          }
        }
      }
      label198:
      super.mouseDragged(paramMouseEvent);
    }
  }
  
  final class a_
    extends og
  {
    private BufferedImage i;
    private BufferedImage ab;
    private ConvolveOp bb;
    
    private boolean M()
    {
      boolean bool = ld.E;
      if (!bool) {
        if (this.bb == null)
        {
          int j = 5;
          double d = 0.9D;
          Object localObject = qg.this.getClientProperty("Overview.funkyTheta");
          if ((bool) || ((localObject instanceof Number))) {
            d = ((Number)localObject).doubleValue();
          }
          float[] arrayOfFloat = qg.a(d, j);
          this.bb = new ConvolveOp(new Kernel(j, j, arrayOfFloat));
        }
      }
      if ((bool) || (this.i != null))
      {
        if (bool) {
          break label138;
        }
        if (getWidth() == this.i.getWidth())
        {
          if (bool) {
            break label240;
          }
          if (getHeight() == this.i.getHeight()) {
            break label239;
          }
        }
      }
      label138:
      if (!bool)
      {
        if (!qg.K)
        {
          this.i = new BufferedImage(getWidth(), getHeight(), 1);
          this.ab = new BufferedImage(getWidth(), getHeight(), 1);
        }
      }
      else
      {
        if (bool) {
          break label238;
        }
        if (!ld.D) {
          break label237;
        }
      }
      this.i = new BufferedImage(getWidth(), getHeight(), 2);
      this.ab = new BufferedImage(getWidth(), getHeight(), 2);
      label237:
      label238:
      return true;
      label239:
      label240:
      return false;
    }
    
    public a_(pg parampg)
    {
      super();
    }
    
    public void paintComponent(Graphics paramGraphics)
    {
      boolean bool = ld.E;
      if (!bool) {
        if (!M())
        {
          if (bool) {
            break label340;
          }
          if (!qg.this.H) {
            break label333;
          }
        }
      }
      BufferedImage localBufferedImage1 = this.ab;
      BufferedImage localBufferedImage2 = this.i;
      Color localColor1 = (Color)qg.this.getClientProperty("Overview.FogColor");
      if ((bool) || (localColor1 == null)) {
        localColor1 = new Color(0.85F, 0.85F, 0.85F, 0.6F);
      }
      if (!bool)
      {
        if (qg.this.H) {
          j();
        }
      }
      else {
        qg.this.H = false;
      }
      Graphics2D localGraphics2D = localBufferedImage2.createGraphics();
      try
      {
        localGraphics2D.setColor(getBackground());
        localGraphics2D.clearRect(0, 0, getWidth(), getHeight());
        localGraphics2D.setClip(0, 0, getWidth(), getHeight());
        super.paintComponent(localGraphics2D);
      }
      finally
      {
        localGraphics2D.dispose();
      }
      if (!bool)
      {
        if ("Funky".equals(qg.this.getClientProperty("Overview.PaintStyle")))
        {
          if (bool) {
            break label292;
          }
          if (!qg.K)
          {
            vc.a(this.bb, this.i, this.ab);
            localGraphics2D = localBufferedImage1.createGraphics();
            try
            {
              localGraphics2D.setColor(localColor1);
              localGraphics2D.fillRect(0, 0, getWidth(), getHeight());
            }
            finally
            {
              localGraphics2D.dispose();
            }
          }
        }
        localGraphics2D = localBufferedImage1.createGraphics();
      }
      try
      {
        label292:
        localGraphics2D.drawImage(this.i, 0, 0, null);
        localGraphics2D.setColor(localColor1);
        localGraphics2D.fillRect(0, 0, getWidth(), getHeight());
      }
      finally
      {
        localGraphics2D.dispose();
      }
      label333:
      label340:
      if (!bool) {
        if (qg.this.H)
        {
          j();
          qg.this.H = false;
        }
      }
      if (Boolean.TRUE.equals(qg.this.getClientProperty("Overview.Inverse")))
      {
        localBufferedImage1 = this.i;
        localBufferedImage2 = this.ab;
        if (bool) {
          break label435;
        }
        if (!ld.D) {}
      }
      else
      {
        localBufferedImage1 = this.ab;
        localBufferedImage2 = this.i;
      }
      paramGraphics.drawImage(localBufferedImage2, 0, 0, null);
      label435:
      int j = e(qg.this.G.a.x);
      int k = f(qg.this.G.a.y);
      int m = Math.max(0, j);
      int n = Math.max(0, k);
      int i1 = e(qg.this.G.a.getMaxX());
      int i2 = f(qg.this.G.a.getMaxY());
      int i3 = Math.min(getWidth(), i1);
      int i4 = Math.min(getHeight(), i2);
      if ((bool) || ((i3 >= m) && ((bool) || (i4 >= n))))
      {
        paramGraphics.drawImage(localBufferedImage1, m, n, i3, i4, m, n, i3, i4, null);
        Color localColor2 = (Color)qg.this.getClientProperty("Overview.BorderColor");
        if (!bool)
        {
          if (localColor2 == null) {
            localColor2 = Color.lightGray;
          }
          paramGraphics.setColor(localColor2);
          paramGraphics.drawRect(j, k, i1 - j, i2 - k);
        }
        if (!bool)
        {
          if (Boolean.TRUE.equals(qg.this.getClientProperty("Overview.AllowZooming"))) {
            paramGraphics.setColor(Color.darkGray);
          }
        }
        else {
          paramGraphics.fillRect(i1 - 1, i2 - 1, 3, 3);
        }
      }
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.qg

 * JD-Core Version:    0.7.0.1

 */